<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emp-toolkit: /Users/wangxiao/git/emp-toolkit/emp-tool/circuits/comparable.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-full-doxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emp-toolkit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('comparable_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">comparable.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="comparable_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef COMPARABLE_H__</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define COMPARABLE_H__</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="class_comparable.html">    5</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_comparable.html">Comparable</a> { <span class="keyword">public</span>:</div><div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="class_comparable.html#a1323067ed9835c123a3c845249e3efc4">    6</a></span>&#160;    <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_comparable.html#a1323067ed9835c123a3c845249e3efc4">operator&gt;=</a>(<span class="keyword">const</span> T&amp;rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)-&gt;geq(rhs);</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;    }</div><div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="class_comparable.html#a7e57a61c6e6553dc24d55a6c58048210">    9</a></span>&#160;    <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_comparable.html#a7e57a61c6e6553dc24d55a6c58048210">operator&lt;</a>(<span class="keyword">const</span> T&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;        <span class="keywordflow">return</span> !( (*<span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<span class="keyword">this</span>))&gt;= rhs );</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    }</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="class_comparable.html#ad5868313aa74a8287b64953a6ff05855">   13</a></span>&#160;    <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_comparable.html#ad5868313aa74a8287b64953a6ff05855">operator&lt;=</a>(<span class="keyword">const</span> T&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;        <span class="keywordflow">return</span> rhs &gt;= *<span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<span class="keyword">this</span>);</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    }</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="class_comparable.html#a1f7c3b914d9e2eb062748fd6a3ab5507">   17</a></span>&#160;    <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_comparable.html#a1f7c3b914d9e2eb062748fd6a3ab5507">operator&gt;</a>(<span class="keyword">const</span> T&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        <span class="keywordflow">return</span> !(rhs &gt;= *<span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<span class="keyword">this</span>));</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    }</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    </div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_comparable.html#ab84fcaeb4718b7058de888f3aa8741bb">   21</a></span>&#160;    <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_comparable.html#ab84fcaeb4718b7058de888f3aa8741bb">operator==</a>(<span class="keyword">const</span> T&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)-&gt;equal(rhs);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    }</div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="class_comparable.html#a5823bd6c40d07ec8743119ab5eae39e4">   24</a></span>&#160;    <a class="code" href="class_bit.html">Bit</a> <a class="code" href="class_comparable.html#a5823bd6c40d07ec8743119ab5eae39e4">operator!=</a>(<span class="keyword">const</span> T&amp; rhs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        <span class="keywordflow">return</span> !(*<span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<span class="keyword">this</span>) == rhs);</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    }</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;};</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="class_comparable_html_a1f7c3b914d9e2eb062748fd6a3ab5507"><div class="ttname"><a href="class_comparable.html#a1f7c3b914d9e2eb062748fd6a3ab5507">Comparable::operator&gt;</a></div><div class="ttdeci">Bit operator&gt;(const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> comparable.h:17</div></div>
<div class="ttc" id="class_comparable_html"><div class="ttname"><a href="class_comparable.html">Comparable</a></div><div class="ttdef"><b>Definition:</b> comparable.h:5</div></div>
<div class="ttc" id="class_comparable_html_a5823bd6c40d07ec8743119ab5eae39e4"><div class="ttname"><a href="class_comparable.html#a5823bd6c40d07ec8743119ab5eae39e4">Comparable::operator!=</a></div><div class="ttdeci">Bit operator!=(const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> comparable.h:24</div></div>
<div class="ttc" id="class_comparable_html_ab84fcaeb4718b7058de888f3aa8741bb"><div class="ttname"><a href="class_comparable.html#ab84fcaeb4718b7058de888f3aa8741bb">Comparable::operator==</a></div><div class="ttdeci">Bit operator==(const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> comparable.h:21</div></div>
<div class="ttc" id="class_bit_html"><div class="ttname"><a href="class_bit.html">Bit</a></div><div class="ttdef"><b>Definition:</b> bit.h:8</div></div>
<div class="ttc" id="class_comparable_html_ad5868313aa74a8287b64953a6ff05855"><div class="ttname"><a href="class_comparable.html#ad5868313aa74a8287b64953a6ff05855">Comparable::operator&lt;=</a></div><div class="ttdeci">Bit operator&lt;=(const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> comparable.h:13</div></div>
<div class="ttc" id="class_comparable_html_a7e57a61c6e6553dc24d55a6c58048210"><div class="ttname"><a href="class_comparable.html#a7e57a61c6e6553dc24d55a6c58048210">Comparable::operator&lt;</a></div><div class="ttdeci">Bit operator&lt;(const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> comparable.h:9</div></div>
<div class="ttc" id="class_comparable_html_a1323067ed9835c123a3c845249e3efc4"><div class="ttname"><a href="class_comparable.html#a1323067ed9835c123a3c845249e3efc4">Comparable::operator&gt;=</a></div><div class="ttdeci">Bit operator&gt;=(const T &amp;rhs) const</div><div class="ttdef"><b>Definition:</b> comparable.h:6</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_eec959d81771dc8b1a750b834e1341eb.html">emp-tool</a></li><li class="navelem"><a class="el" href="dir_2b4671b717884caf3b3fe5ce6896c1bb.html">circuits</a></li><li class="navelem"><a class="el" href="comparable_8h.html">comparable.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.12 </li>
  </ul>
</div>
</body>
</html>
